<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddWorkTodayCaCustomers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('ca__customers', function (Blueprint $table) {
            $table->boolean('is_work_today')->default(0)->comment('是否今日工作');
            $table->boolean('is_public')->default(0)->comment('是否加入公海（公共资源）');
            $table->timestamp('last_visit_time')->nullable()->comment('最后回访时间');
            $table->unsignedBigInteger('last_visit_user_id')->nullable()->comment('最后回访用户ID');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('ca__customers', function (Blueprint $table) {
            $table->dropColumn('is_work_today');
            $table->dropColumn('is_public');
            $table->dropColumn('last_visit_time');
            $table->dropColumn('last_visit_user_id');
        });
    }
}
